import React, { useEffect, useState } from 'react'
import { ConfigProvider, Space } from 'antd'
import LeftSideBar from './component/LeftSideBar'
import RightMain from './component/RightMain'
import { useScanRegistrationStore } from './store'
import CommonLoading from '@/components/CommonLoading'
import { getAfterSalesScanConfig } from './service'

const ScanRegistration = () => {
  const {isLoading, updateState} = useScanRegistrationStore()
  useEffect(() => {
    getAfterSalesScanConfig().then(res => {
      updateState({ pageConfig: res.data })
    })
  }, [])
  return <ConfigProvider componentSize="middle">
    <div style={{display: 'flex', height: '100%'}}>
      <LeftSideBar />
      <RightMain />
      <CommonLoading loading={isLoading} />
    </div>
  </ConfigProvider>
}

export default ScanRegistration